package org.conditure.web;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Represents a web payload.
 * 
 * @author Elvir
 */
public abstract class WebPayload {
	/**
	 * Creates an empty payload.
	 */
	public WebPayload() { }
		
	/**
	 * Loads the message from the stream into this payload.
	 * 
	 * @param stream
	 * @throws IOException 
	 */
	public abstract void read(InputStream stream) throws IOException;
	
	/**
	 * Writes the payload into the given input stream.
	 * 
	 * @param stream
	 * @throws IOException
	 */
	public abstract void write(OutputStream stream) throws IOException;
}
